-
Notifications
You must be signed in to change notification settings - Fork 121
[Mobile Payments] Check built in card reader requirements #8595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mobile Payments] Check built in card reader requirements #8595
Conversation
We will need the checkSupport function Stripe provide to check whether a given device supports the built-in card reader. The simpler Apple version is more permissive, e.g. it says support is available from iOS 15.5, however via Stripe, 16.0 is the minimum.
Previously the logic for when we show the `Tap to Pay on iPhone` or `Bluetooth reader` screen was in the preflight controller, using Apple’s API’s. Stripe’s support is more restricted than Apple’s, and has been exposed via the CardPresentPaymentsStore. This commit updates the PreflightController to use the exposed Stripe check.
You can test the changes from this Pull Request by:
|
|
@toupper Not sure what devices you have to test with: would appreciate your review and a list of it either way, since you have context on the feature. I can ask for further reviews as needed to fully test though. @lmischner @jostnes This seems like a PR which would particularly benefit from testing, since it needs physical devices to do it properly, of various ages and OS versions. See my note in the PR for what I've been able to test and feel free to add scenarios which need checking. |
|
I was only able to test out scenarios 1 and 4 with the devices I have: Scenario 1: iPhone 13 Pro [iOS 16.2] - Payments using both Scenario 4: iPhone 13 mini [iOS 15.7.1] - Payments using the BBPOS Chipper card reader work without issue and |
|
@joshheald Great job, the code looks good to me, I just added a non-blocker. |
| public func checkSupport(for cardReaderType: CardReaderType, | ||
| configProvider: CardReaderConfigProvider, | ||
| discoveryMethod: CardReaderDiscoveryMethod) -> Bool { | ||
| return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A non blocker here, you can omit return if you want
Closes: #8314
Description
In sTAP Away, we're adding support for Tap to Pay on iPhone, using Stripe's Terminal SDK to access the feature.
Apple's requirements for TTP are documented as needing iOS 15.5, on an iPhone XS or newer, and in US-based stores. However, Stripe's SDK is more stringent, and only makes the feature available for iPhones (not iPads) running iOS 16 or newer.
This PR updates the device and OS checks using Stripe's rules.
Background
When we did the proof of concept, we relied on Apple's
PaymentCardReader.isSupportedproperty, and didn't see a function in Stripe's SDK for checking support, as it was done intrinsically when we tried to discover a reader.Unfortunately, this is not a suitable flow for our app, as we give the user an upfront choice of the reader type they want to use. In the production version of Stripe's SDK, there is a
checkDeviceSupportfunction which allows us to find this detail out according to Stripe's rules.Testing instructions
N.B. To fully test this on device needs a lot of test devices, more than I have available. I have checked scenarios 1 and 5 on device, and all scenarios on the simulator.
Unfortunately, Stripe's terminal simulator is returning
truefor iPhone X and iPhone 8, which doesn't reflect the published device support, so scenario 3 is essentially untested, or failing the test. I've reached out to Stripe about this, but if anyone is able to test that specific scenario on device, I'd appreciate you noting it in the comments 😊1. Using an iPhone XS or newer on iOS 16.0 or newer on a US store
Menu > Settings > Experimental featuresTap to Pay on iPhoneMenu > Payments > Collect paymentCardon the payment method screenTap to Pay on iPhoneand go through the Terms of Service Apple ID linking (if you've not done so before)2. Using an iPad on iOS 16.0 or newer on a US store
Menu > Settings > Experimental featuresTap to Pay on iPhoneMenu > Payments > Collect paymentCardon the payment method screen3. Using an iPhone X or older on iOS 16.0 or newer on a US store
As for iPad above
4. Using an iPhone XS or newer on iOS 15.7.2 or older on a US store
As for iPad above
5. Using an iPhone X or older on iOS 15.7.2 or older on a US store
As for iPad above
Screenshots
ttpoi.mp4
RELEASE-NOTES.txtif necessary.